<template>
    <div class="he">
        <van-nav-bar title="购物车" left-text="" right-text="我的订单" left-arrow @click-left="onClickLeft" />
        <div class="good">

            <div class="head ">
                <div>
                    <img src="https://fastly.jsdelivr.net/npm/@vant/assets/ipad.jpeg" alt="">
                    <span>name</span>
                </div>
                <span>中山大学</span>
            </div>
            <div class="form">
                <van-checkbox v-model="checked" checked-color="#ee0a24"></van-checkbox>
            </div>
            <div class="book">
                <van-icon name="cross" />
                <img src="https://fastly.jsdelivr.net/npm/@vant/assets/ipad.jpeg" alt="">
                <ul>
                    <li>
                        <p>
                            词典
                        </p>
                    </li>
                    <li>全新</li>
                    <li>
                        <b> ￥16.00</b><span class="shu">￥897</span>
                    </li>
                </ul>
                <van-stepper v-model="value" />
            </div>
        </div>
        <div>
            <router-link to="/order">
                <van-submit-bar :price="3050" button-text="结算" />
            </router-link>
        </div>
    </div>
</template>

<script setup>
import { ref } from 'vue'
import { useRouter } from 'vue-router';
const router = useRouter()
const checked = ref('');
const value = ref(1);
//点击后退
const onClickLeft = () => {
    router.go(-1)
}
</script>
<style lang="scss" scoped>
.he {
    background-color: #f8f8f8;
    height: 100vh;
}

.shu {
    text-decoration: line-through;
    margin-left: 10px;
}


.book {
    display: flex;
    position: relative;

    ul {
        margin-left: 5px;
    }

    li {
        margin-top: 10px;

        b {
            color: #d5b376;
        }

        span {
            color: #aaaaaa;
        }
    }

    .van-icon {
        position: absolute;
        top: 0;
        right: 6px;
    }

    .van-stepper {
        position: absolute;
        top: 75px;
        right: 6px;
    }
}

.form {
    position: relative;
}

::v-deep .van-checkbox__icon {
    position: absolute;
    top: 42px;
    left: 8px;
    z-index: 1
}

.good .head {
    display: flex;
    align-items: center;
    justify-content: space-between;

    >div {
        display: flex;
        align-items: center;
    }

    span {
        padding-left: 5px;
        padding-right: 10px;
    }

    img {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        margin: 0;
        margin: 5px 0 0 10px;
    }
}

.good {
    width: 370px;
    height: 180px;
    margin-top: 10px;
    background-color: #fff;
    box-shadow: 0px 7px 10px #D3D3D3;
    margin: 0 10px 0 10px;
    border-radius: 3px;

    img {
        width: 80px;
        height: 100px;
        border-radius: 10px;
        margin: 4px 0px 0px 35px;

    }
}

::v-deep .van-nav-bar__title {
    font-size: 18px;
}

::v-deep .van-nav-bar__text {
    font-size: 16px;
    color: #000;
}

::v-deep .van-nav-bar .van-icon {
    color: #000;
    font-size: 18px;
}
</style>
